package org.itboys.mobile.entity.mongo;


import com.fasterxml.jackson.annotation.JsonIgnore;
import org.itboys.mobile.entity.mysql.TianJieWallet;
import org.itboys.mongodb.entity.BaseMongoEntity;
import org.mongodb.morphia.annotations.Entity;
import org.mongodb.morphia.annotations.Indexed;
import org.mongodb.morphia.annotations.NotSaved;

import java.math.BigDecimal;
import java.util.List;

/**
 * 作者：jiangxiong
 * 日期：2017年10月26日
 * 联系方式 ：empty90911@126.com
 * 天街_金融_用户_实体。金融和商城。共享一个用户实体。
 */
@Entity(value="TianJieMember", noClassnameStored=true)
public class TianJieMember extends BaseMongoEntity {

	//商城的用户属性。直接继承
    private String userName;//登陆账号。手机号
    private String password;//密码
    private String nickName;//昵称
    private String logo;//头像
    private Integer userType;//普通用户1，万品门店2，周边商家3。金融模块只有用户
    private Integer isWeixinLogin;//1是，2否。为null也是否
    @JsonIgnore
    private Integer isQqLogin;//1是，2否。为null也是否
    @JsonIgnore
    private Integer isWeiboLogin;//1是，2否。为null也是否
    //金融的用户属性
    private Long financeTjId;//金融用户推荐人ID
    private String financeTjPath;//金融用户推荐链。默认自己的ID即。/ID/
    private String financeTjFirstPath;//金融用户推荐下级（第一级）集合。即该用户的区域。/ID/
    //private Double fin
    private Long financeGroupId;//金融组织ID
    private String financeGroupName;//金融组织名称
    private Integer financeIsCaptain;//0否，1是。
    private Integer financeIsFinance;//是否是金融用户。充值消费卡后才能成为金融用户
    private String financeEwm;//推广用户二维码；

    private List<TianJieMember> children;
    @Indexed
    private Long zoneId;//区域ID.以地级市控制用户数据.(取用户组织ID)
    private String financeBitAddress;//用户小比特币地址

    //钱包相关
    @NotSaved
    private BigDecimal totalAmount;//总余额。来源，1自己充值，2拨付，
    @NotSaved
    private BigDecimal releaseAmount;//已释放金额即周薪（可提现）。来源：1，待释放金额，
    @NotSaved
    private BigDecimal cashAmount;//现金金额即日薪（可提现）。来源。1,推荐用户充值
    @NotSaved
    private BigDecimal profitAmount;//区块链收益即理财（可提现）。来源。1，退出区块链时，可用金额超出本金的部分
    //业绩等级相关
    @NotSaved
    private BigDecimal totalAchievement;//总业绩
    @NotSaved
    private Integer walletStatus;//钱包状态
    //2017年12月25日，区块链钱包相关
    @NotSaved
    private BigDecimal baseAmount;//本金
    @NotSaved
    private BigDecimal ableAmount;//可用本金
    @NotSaved
    private BigDecimal blockNumber;//持币数量
    @NotSaved
    private Integer saleDay;//持币自动卖出天数。没有就从字典中获取

    public TianJieMember() {
    }

    public TianJieMember(Long id,Long financeGroupId, Integer financeIsCaptain, Integer financeIsFinance) {
        super.setId(id);
        this.financeGroupId = financeGroupId;
        this.financeIsCaptain = financeIsCaptain;
        this.financeIsFinance = financeIsFinance;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getNickName() {
        return nickName;
    }

    public void setNickName(String nickName) {
        this.nickName = nickName;
    }

    public String getLogo() {
        return logo;
    }

    public void setLogo(String logo) {
        this.logo = logo;
    }

    public Integer getUserType() {
        return userType;
    }

    public void setUserType(Integer userType) {
        this.userType = userType;
    }

    public Integer getIsWeixinLogin() {
        return isWeixinLogin;
    }

    public void setIsWeixinLogin(Integer isWeixinLogin) {
        this.isWeixinLogin = isWeixinLogin;
    }

    public Integer getIsQqLogin() {
        return isQqLogin;
    }

    public void setIsQqLogin(Integer isQqLogin) {
        this.isQqLogin = isQqLogin;
    }

    public Integer getIsWeiboLogin() {
        return isWeiboLogin;
    }

    public void setIsWeiboLogin(Integer isWeiboLogin) {
        this.isWeiboLogin = isWeiboLogin;
    }

    public Long getFinanceTjId() {
        return financeTjId;
    }

    public void setFinanceTjId(Long financeTjId) {
        this.financeTjId = financeTjId;
    }

    public String getFinanceTjPath() {
        return financeTjPath;
    }

    public void setFinanceTjPath(String financeTjPath) {
        this.financeTjPath = financeTjPath;
    }

    public String getFinanceTjFirstPath() {
        return financeTjFirstPath;
    }

    public void setFinanceTjFirstPath(String financeTjFirstPath) {
        this.financeTjFirstPath = financeTjFirstPath;
    }

    public Long getFinanceGroupId() {
        return financeGroupId;
    }

    public void setFinanceGroupId(Long financeGroupId) {
        this.financeGroupId = financeGroupId;
    }

    public String getFinanceGroupName() {
        return financeGroupName;
    }

    public void setFinanceGroupName(String financeGroupName) {
        this.financeGroupName = financeGroupName;
    }

    public Integer getFinanceIsCaptain() {
        return financeIsCaptain;
    }

    public void setFinanceIsCaptain(Integer financeIsCaptain) {
        this.financeIsCaptain = financeIsCaptain;
    }

    public Integer getFinanceIsFinance() {
        return financeIsFinance;
    }

    public void setFinanceIsFinance(Integer financeIsFinance) {
        this.financeIsFinance = financeIsFinance;
    }

    public String getFinanceEwm() {
        return financeEwm;
    }

    public void setFinanceEwm(String financeEwm) {
        this.financeEwm = financeEwm;
    }

    public BigDecimal getTotalAmount() {
        return totalAmount;
    }

    public void setTotalAmount(BigDecimal totalAmount) {
        this.totalAmount = totalAmount;
    }

    public BigDecimal getReleaseAmount() {
        return releaseAmount;
    }

    public void setReleaseAmount(BigDecimal releaseAmount) {
        this.releaseAmount = releaseAmount;
    }

    public BigDecimal getCashAmount() {
        return cashAmount;
    }

    public void setCashAmount(BigDecimal cashAmount) {
        this.cashAmount = cashAmount;
    }

    public BigDecimal getProfitAmount() {
        return profitAmount;
    }

    public void setProfitAmount(BigDecimal profitAmount) {
        this.profitAmount = profitAmount;
    }

    public BigDecimal getTotalAchievement() {
        return totalAchievement;
    }

    public void setTotalAchievement(BigDecimal totalAchievement) {
        this.totalAchievement = totalAchievement;
    }

    public Integer getWalletStatus() {
        return walletStatus;
    }

    public void setWalletStatus(Integer walletStatus) {
        this.walletStatus = walletStatus;
    }

    public Long getZoneId() {
        return zoneId;
    }

    public void setZoneId(Long zoneId) {
        this.zoneId = zoneId;
    }

    public String getFinanceBitAddress() {
        return financeBitAddress;
    }

    public void setFinanceBitAddress(String financeBitAddress) {
        this.financeBitAddress = financeBitAddress;
    }

    public List<TianJieMember> getChildren() {
        return children;
    }

    public void setChildren(List<TianJieMember> children) {
        this.children = children;
    }

    public BigDecimal getBaseAmount() {
        return baseAmount;
    }

    public void setBaseAmount(BigDecimal baseAmount) {
        this.baseAmount = baseAmount;
    }

    public BigDecimal getAbleAmount() {
        return ableAmount;
    }

    public void setAbleAmount(BigDecimal ableAmount) {
        this.ableAmount = ableAmount;
    }

    public BigDecimal getBlockNumber() {
        return blockNumber;
    }

    public void setBlockNumber(BigDecimal blockNumber) {
        this.blockNumber = blockNumber;
    }

    public Integer getSaleDay() {
        return saleDay;
    }

    public void setSaleDay(Integer saleDay) {
        this.saleDay = saleDay;
    }

    //bootstrap下，树形菜单需要用到此属性
    public  boolean getExpanded(){
    /*    if(children!=null&&children.size()>0){
            return true;
        }else{
            return false;
        }*/
    return false;
    }

}
